// AWTButton.h: interface for the AWTButton class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_AWTBUTTON_H__CE760843_3E56_11D2_A3F0_006097A44215__INCLUDED_)
#define AFX_AWTBUTTON_H__CE760843_3E56_11D2_A3F0_006097A44215__INCLUDED_

#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000

#include "AWTComponent.h"

class AFX_EXT_CLASS AWTButton : public AWTComponent  
{
DECLARE_DYNAMIC(AWTButton)
public:
	AWTButton();
	AWTButton(LPTSTR label);
	AWTButton(CString label);
	virtual ~AWTButton();

	CSize getMinimumSize();
	CSize getPreferredSize();

	CString& getLabel()	
		{return m_label;}
	void setLabel(CString label)
		{m_label = label;}
	void setLabel(LPTSTR label)
		{setLabel(CString(label));}
	void setDefault(BOOL b);
	BOOL getDefault()
		{return m_default;}
	
	void addActionListener(AWTActionListener* l) 
		{m_actionListener = AWTEventMulticaster::add(m_actionListener, l);}
  void removeActionListener(AWTActionListener* l) 
		{m_actionListener = AWTEventMulticaster::remove(m_actionListener, l);}
	void processActionEvent(AWTActionEvent* e);
	virtual BOOL isFocusTraversable()
		{return TRUE;}
		
private:
	void construct(CString label)
	{
		m_label = label;
		m_actionListener = NULL;
		m_default = FALSE;
	}

protected:
	CWnd* createComponent();

	CString m_label;
  AWTActionListener* m_actionListener;
	BOOL m_default;
};

#endif // !defined(AFX_AWTBUTTON_H__CE760843_3E56_11D2_A3F0_006097A44215__INCLUDED_)
